<%@ page language="java" contentType="text/html; charset=euc-kr"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>FindIt</title>
<link rel="stylesheet" type="text/css" href="/resources/css/ncs.css" />
<style type="text/css">
.input_text {
	position: relative;
	height: 16px;
	_height /**/: 22px;
	*margin: -1px 0;
	padding: 4px 2px 0;
	border: 1px solid #bebebe;
	color: #444;
	font-size: 12px;
	vertical-align: top;
	white-space: nowrap
}

.input_text {
	padding-top: 2px;
	padding-bottom: 2px
}

.input_text.focus {
	border: 1px solid #5aa409;
	background: #fff !important
}

.input_text.focusnot {
	background: #fff !important
}
</style>
<script type="text/javascript" src="/resources/js/jquery.js"></script>
<script type="text/javascript" src="/resources/js/paging.js"
	charset="utf-8"></script>
<script type="text/javascript" src="/resources/fckeditor/fckeditor.js"></script>
<script language="javascript">
	$(function($) {
	    $(".num").keydown(numOnlyInput);
		$('#btn_modal_bi').click(function() {
		if(confirm('등록하시겠습니까?')){
			if(check()){
				document.searchForm.method="post";
				document.searchForm.action="<%=request.getContextPath()%>/admin/addSkill.json";
				document.searchForm.submit();
				}else{
					return;
				}
		
		}
		});
		$('#btn_modal1_bi').click(function() {
			fncSearchList();
		});
	});
	
	function fncSearchList(){
		document.frm.action="<%=request.getContextPath()%>/admin/SkillList.json";
		document.frm.submit();
	}
	var numOnlyInput = function (event) {
	       if (!(event.keyCode == 8                                // backspace
	            || event.keyCode == 9                               // tab
	            || event.keyCode == 17                              // ctrl
	            || event.keyCode == 46                              // delete
	            || (event.keyCode >= 35 && event.keyCode <= 40)     // arrow keys/home/end
	            || (event.keyCode >= 48 && event.keyCode <= 57)     // numbers on keyboard
	            || (event.keyCode >= 96 && event.keyCode <= 105)    // number on keypad
	            || (event.keyCode == 65 && prevKey == 17 && prevControl == event.currentTarget.id))          // ctrl + a, on same control
	        ) {
	            event.preventDefault();     // Prevent character input
	        }
	        else {
	            prevKey = event.keyCode;
	            prevControl = event.currentTarget.id;
	        }
	    };
	    
	function check(){
		var confirm= true;
		$("input[require]").each(
				function(){
					 if(this.value ==''){
						 alert($(this).attr("title")+"는 필수입력 입니다.");
						 $(this).focus();
						 confirm = false;
						 return false;
					 }
				});	
		return confirm;
	}
</script>
</head>
<body onload="fncInit();">
	<!-- top Area -->
	<jsp:include page="/WEB-INF/views/include/top.jsp"></jsp:include>
	<!-- cntWrap : Start -->
	<div id="cntWrap">
		<!-- secNavi Area -->
		<div id="secNavi">
			<h2>스킬관리</h2>
			<ul>
				<li class="first-child"><a
					href="<%=request.getContextPath()%>/admin/imageList.json"><span>이미지관리</span></a></li>
				<li><a
					href="<%=request.getContextPath()%>/admin/gameItemList.json"><span>아이템관리</span></a></li>
				<li><a
					href="<%=request.getContextPath()%>/admin/skillList.json"><span>스킬관리</span></a></li>
				<li><a
					href="<%=request.getContextPath()%>/admin/characterList.json"><span>캐릭터관리</span></a></li>
				<li><a
					href="<%=request.getContextPath()%>/admin/adImageList.json"><span>광고관리</span></a></li>
				<li><a
					href="<%=request.getContextPath()%>/admin/noticeList.json"><span>공지사항관리</span></a></li>
				<li><a
					href="<%=request.getContextPath()%>/admin/memberList.json"><span>회원관리</span></a></li>
				<li><a href="<%=request.getContextPath()%>/admin/itemPurchaseHistList.json"><span>아이템구매내역</span></a></li>
			</ul>
		</div>
		<hr />
		<form method="post" name="frm"></form>
		<!-- Contents Area : Start -->
		<form method="post" name="searchForm" enctype="multipart/form-data">
			<div id="cntArea">
				<h2>스킬관리</h2>
				<table border="0" width="589" height="200">
					<tr>
						<td><b>스킬등록</b><br />
						<br /> 상태 <select name="state">
								<option value="Y">활성화</option>
								<option value="N">비활성화</option>
						</select></td>
					</tr>
					<tr>
						<td rowspan="13" width="120"><img
							src="/resources/images/on.gif" width="100" height="100" /></td>
					</tr>
					<tr>
						<td width="10">&nbsp;&nbsp;스킬명</td>
						<td><input type="text" name="skillName" require title="설명"
							size="30" maxlength="30" value="" /></td>
					</tr>
					<tr>
						<td width="10">&nbsp;&nbsp;레벨</td>
						<td><input type="text" class="num" name="level" require
							title="설명" size="30" maxlength="2" value="" /></td>
					</tr>
					<tr>
						<td width="10">&nbsp;&nbsp;포인트</td>
						<td><input type="text" class="num" name="point" require
							title="설명" size="30" maxlength="4" value="" /></td>
					</tr>
					<tr>
						<td width="10">&nbsp;&nbsp;능력치</td>
						<td><input type="text" name="abilityPower" id="abilityPower"
							require title="능력치" size="30" maxlength="10"
							value="<c:out value="${view.abilityPower}"/>" /></td>
					</tr>
					<tr>
						<td width="10">&nbsp;&nbsp;설명</td>
						<td><textarea rows="4" cols="30" name="remark"></textarea></td>
					</tr>
					<tr>
						<td><input type="file" name="file" value="파일 업로드 " require
							title="이미지" size="15" /></td>
					</tr>
				</table>
			</div>
		</form>
		<div class="btnArea">
			<div>
				<input type="button" class="btnCss1" value="등록" id="btn_modal_bi" />
				<input type="button" class="btnCss1" value="목록" id="btn_modal1_bi" />
			</div>
		</div>
	</div>
	<!-- Contents End -->

	<jsp:include page="/WEB-INF/views/include/footer.jsp"></jsp:include>
</body>
</html>